package com.itlong.cloud.commons.resource;

import com.itlong.cloud.commons.service.IDeviceAlarmPushMessageService;
import com.itlong.cloud.noncore.commons.IDeviceAlarmPushMessageServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      告警事件上报后主动向前端推送消息
 * </desc>
 *
 * @createDate 2021/06/03
 */
@RestController
public class DeviceAlarmPushMessageServiceResource implements IDeviceAlarmPushMessageServiceClient {
    @Autowired
    IDeviceAlarmPushMessageService iDeviceAlarmPushMessageService;

    /**
     * <desc>
     *     告警事件上报后主动向前端推送消息
     * </desc>
     * @param projectId 项目编号
     *
     * @return
     * @author JuGuang.S
     * @createDate 2021/06/03
     */
    @RequestMapping(path = "/timeTask/deviceAlarmPushMessage")
    public void deviceAlarmPushMessage(@RequestParam("projectId") String projectId,
                                       @RequestParam("remark") boolean remark,
                                       @RequestParam(value = "eventSeq",required = false) String eventSeq) throws Exception{
        iDeviceAlarmPushMessageService.deviceAlarmPushMessage(projectId,remark,eventSeq);
    }
}
